//
//  BaseViewController.m
//  CMVRFForIOS
//
//  Created by HailongHan on 15/3/27.
//  Copyright (c) 2015年 hvacapp. All rights reserved.
//

#import "BaseViewController.h"
#import "AppDelegate.h"

@interface BaseViewController ()

/** 导航左边返回 */
@property (strong, nonatomic)UIButton *leftNavBtn;
/** 膜态title */
@property(nonatomic,strong)UILabel *titlabel;
/** 膜态返回按钮 */
@property(nonatomic,strong)UIButton *backBtn;
/** 分割线 */
@property(nonatomic,strong)UIImageView *line;

@end

@implementation BaseViewController

//-(instancetype)init {
//    self = [super init];
//    if (self) {
//        //创建一个返回的按钮
//        UIImage *bakImg = [UIImage imageNamed:@"nav_back"];
//        self.leftNavBtn = [UIButton buttonWithType:UIButtonTypeCustom];
//        self.leftNavBtn.frame = CGRectMake(15, kNavigation_Bar_Height/2 - 22/2, 22, 22);
//        self.leftNavBtn.titleLabel.textAlignment = NSTextAlignmentLeft;
//        self.leftNavBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 22 - bakImg.size.width);
//        
//        self.leftNavBtn.titleLabel.font = [UIFont systemFontOfSize:18];
//        [self.leftNavBtn setImage:bakImg forState:UIControlStateNormal];
//        [self.leftNavBtn addTarget:self action:@selector(backSuperView) forControlEvents:UIControlEventTouchUpInside];
//        [self.leftNavBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//        UIBarButtonItem *barItem = [[UIBarButtonItem alloc]initWithCustomView:self.leftNavBtn];
//        self.navigationItem.leftBarButtonItem = barItem;
//    }
//    return self;
//}
//
///**
// *    @brief    点击返回按钮
// */
//- (void)backSuperView {
//    //添加返回埋点
//    [self.navigationController popViewControllerAnimated:YES];
//}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = CM_WINDOW_BG_COLOR;
}

-(void)showLoginViewController{
    [((AppDelegate *)[UIApplication sharedApplication].delegate) showLoginViewController];
}

- (void)showMainViewController{
    [((AppDelegate *)[UIApplication sharedApplication].delegate) showMainViewController];
}


@end
